package com.jindu.producer.system.model;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Objects;

/**
 * @author jarvis
 */
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "s_users", schema = "joint-office", catalog = "")
public class SUsersEntity implements Serializable {
    @Id
    private String id;
    private String account;
    private String pwd;
    private String chineseName;
    private String email;
    private String mobile;
    private Timestamp lastDate;
    private String sex;
    private Timestamp birthday;
    private String nationality;
    private String province;
    private String cities;
    private Timestamp registerTime;
    private int status;
    private Integer loginType;
    private String skin;
    private Timestamp modifyTime;
    private String modifyId;
    private String roleId;
    private String imageUrl;
    private Integer userType;
    private String nickname;
    private Integer registerType;
    private String registerCode;
    private String qqNumber;
    private String wechat;
    private String weibo;
    private String qqAccount;
    private String weiboAccount;
    private String wechatAccount;
    private String skype;
    private String openId;


    @Id
    @Column(name = "id", nullable = false, length = 36)
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "account", nullable = true, length = 50)
    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    @Basic
    @Column(name = "pwd", nullable = true, length = 50)
    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    @Basic
    @Column(name = "chinese_name", nullable = true, length = 50)
    public String getChineseName() {
        return chineseName;
    }

    public void setChineseName(String chineseName) {
        this.chineseName = chineseName;
    }

    @Basic
    @Column(name = "email", nullable = true, length = 50)
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Basic
    @Column(name = "mobile", nullable = true, length = 30)
    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    @Basic
    @Column(name = "last_date", nullable = true)
    public Timestamp getLastDate() {
        return lastDate;
    }

    public void setLastDate(Timestamp lastDate) {
        this.lastDate = lastDate;
    }

    @Basic
    @Column(name = "sex", nullable = true, length = 10)
    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Basic
    @Column(name = "birthday", nullable = true)
    public Timestamp getBirthday() {
        return birthday;
    }

    public void setBirthday(Timestamp birthday) {
        this.birthday = birthday;
    }

    @Basic
    @Column(name = "nationality", nullable = true, length = 100)
    public String getNationality() {
        return nationality;
    }

    public void setNationality(String nationality) {
        this.nationality = nationality;
    }

    @Basic
    @Column(name = "province", nullable = true, length = 100)
    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    @Basic
    @Column(name = "cities", nullable = true, length = 100)
    public String getCities() {
        return cities;
    }

    public void setCities(String cities) {
        this.cities = cities;
    }

    @Basic
    @Column(name = "register_time", nullable = true)
    public Timestamp getRegisterTime() {
        return registerTime;
    }

    public void setRegisterTime(Timestamp registerTime) {
        this.registerTime = registerTime;
    }

    @Basic
    @Column(name = "status", nullable = false)
    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Basic
    @Column(name = "login_type", nullable = true)
    public Integer getLoginType() {
        return loginType;
    }

    public void setLoginType(Integer loginType) {
        this.loginType = loginType;
    }

    @Basic
    @Column(name = "skin", nullable = true, length = 20)
    public String getSkin() {
        return skin;
    }

    public void setSkin(String skin) {
        this.skin = skin;
    }

    @Basic
    @Column(name = "modify_time", nullable = true)
    public Timestamp getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Timestamp modifyTime) {
        this.modifyTime = modifyTime;
    }

    @Basic
    @Column(name = "modify_id", nullable = true, length = 36)
    public String getModifyId() {
        return modifyId;
    }

    public void setModifyId(String modifyId) {
        this.modifyId = modifyId;
    }

    @Basic
    @Column(name = "role_id", nullable = true, length = 36)
    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    @Basic
    @Column(name = "image_url", nullable = true, length = 300)
    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    @Basic
    @Column(name = "user_type", nullable = true)
    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    @Basic
    @Column(name = "nickname", nullable = true, length = 50)
    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    @Basic
    @Column(name = "register_type", nullable = true)
    public Integer getRegisterType() {
        return registerType;
    }

    public void setRegisterType(Integer registerType) {
        this.registerType = registerType;
    }

    @Basic
    @Column(name = "register_code", nullable = true, length = 36)
    public String getRegisterCode() {
        return registerCode;
    }

    public void setRegisterCode(String registerCode) {
        this.registerCode = registerCode;
    }

    @Basic
    @Column(name = "qq_number", nullable = true, length = 30)
    public String getQqNumber() {
        return qqNumber;
    }

    public void setQqNumber(String qqNumber) {
        this.qqNumber = qqNumber;
    }

    @Basic
    @Column(name = "wechat", nullable = true, length = 30)
    public String getWechat() {
        return wechat;
    }

    public void setWechat(String wechat) {
        this.wechat = wechat;
    }

    @Basic
    @Column(name = "weibo", nullable = true, length = 200)
    public String getWeibo() {
        return weibo;
    }

    public void setWeibo(String weibo) {
        this.weibo = weibo;
    }

    @Basic
    @Column(name = "qq_account", nullable = true, length = 36)
    public String getQqAccount() {
        return qqAccount;
    }

    public void setQqAccount(String qqAccount) {
        this.qqAccount = qqAccount;
    }

    @Basic
    @Column(name = "weibo_account", nullable = true, length = 36)
    public String getWeiboAccount() {
        return weiboAccount;
    }

    public void setWeiboAccount(String weiboAccount) {
        this.weiboAccount = weiboAccount;
    }

    @Basic
    @Column(name = "skype", nullable = true, length = 36)
    public String getSkype() {
        return skype;
    }

    public void setSkype(String skype) {
        this.skype = skype;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SUsersEntity that = (SUsersEntity) o;
        return status == that.status &&
                Objects.equals(id, that.id) &&
                Objects.equals(account, that.account) &&
                Objects.equals(pwd, that.pwd) &&
                Objects.equals(chineseName, that.chineseName) &&
                Objects.equals(email, that.email) &&
                Objects.equals(mobile, that.mobile) &&
                Objects.equals(lastDate, that.lastDate) &&
                Objects.equals(sex, that.sex) &&
                Objects.equals(birthday, that.birthday) &&
                Objects.equals(nationality, that.nationality) &&
                Objects.equals(province, that.province) &&
                Objects.equals(cities, that.cities) &&
                Objects.equals(registerTime, that.registerTime) &&
                Objects.equals(loginType, that.loginType) &&
                Objects.equals(skin, that.skin) &&
                Objects.equals(modifyTime, that.modifyTime) &&
                Objects.equals(modifyId, that.modifyId) &&
                Objects.equals(roleId, that.roleId) &&
                Objects.equals(imageUrl, that.imageUrl) &&
                Objects.equals(userType, that.userType) &&
                Objects.equals(nickname, that.nickname) &&
                Objects.equals(registerType, that.registerType) &&
                Objects.equals(registerCode, that.registerCode) &&
                Objects.equals(qqNumber, that.qqNumber) &&
                Objects.equals(wechat, that.wechat) &&
                Objects.equals(weibo, that.weibo) &&
                Objects.equals(qqAccount, that.qqAccount) &&
                Objects.equals(weiboAccount, that.weiboAccount) &&
                Objects.equals(openId, that.openId) &&
                Objects.equals(skype, that.skype);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, account, pwd, chineseName, email, mobile, lastDate, sex, birthday, nationality, province, cities, registerTime, status, loginType, skin, modifyTime, modifyId, roleId, imageUrl, userType, nickname, registerType, registerCode, qqNumber, wechat, weibo, qqAccount, weiboAccount, openId, skype);
    }

    @Basic
    @Column(name = "open_id")
    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    @Basic
    @Column(name = "wechat_account")
    public String getWechatAccount() {
        return wechatAccount;
    }

    public void setWechatAccount(String wechatAccount) {
        this.wechatAccount = wechatAccount;
    }
}
